import ajax from './request'
/**
 * @get  params
 * @post data
 */

export const getTableData = () => {
  return ajax.get('/api/findAll')
}

export const pageData = (params) => {
  // console.log(params, '----params')
  return ajax.get('/api/page', {
    params: { ...params }
  })
}
// http://localhost:7001/api/add
export const addPageData = (data) => {
  return ajax.post('/api/add', data)
}

export const deleteItem = (params) => {
  return ajax.get('/api/delete', {
    params: { ...params }
  })
}

export const updateItem = (data) => {
  return ajax.post('/api/update', data)
}